package ar.edu.utn.frsf.proyectofinal.sistemadecontrolmodbus.service.factories.imp;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import ar.edu.utn.frsf.proyectofinal.sistemadecontrolmodbus.persistence.model.User;
import ar.edu.utn.frsf.proyectofinal.sistemadecontrolmodbus.service.SystemService;
import ar.edu.utn.frsf.proyectofinal.sistemadecontrolmodbus.service.UserDataService;
import ar.edu.utn.frsf.proyectofinal.sistemadecontrolmodbus.service.factories.UserDataServiceFactory;
import ar.edu.utn.frsf.proyectofinal.sistemadecontrolmodbus.service.imp.UserDataServiceImp;
import ar.edu.utn.frsf.proyectofinal.sistemadecontrolmodbus.persistence.UserDAO;

@Component
public class UserDataServiceFactoryImp implements UserDataServiceFactory {

	//TODO: Completo
	@Autowired(required = true)
	private UserDAO userdao;
	
	@Override
	public UserDataService createService(User user,SystemService systemservice) {
		UserDataServiceImp ret = new UserDataServiceImp();
		ret.setUserdao(userdao);
		ret.setSystemservice(systemservice);
		ret.setUserlogged(user);
		
		return ret;
	}

	/**
	 * @return the userdao
	 */
	public UserDAO getUserdao() {
		return userdao;
	}

	/**
	 * @param userdao the userdao to set
	 */
	public void setUserdao(UserDAO userdao) {
		this.userdao = userdao;
	}

}
